package com.acme.bankapp.domain.client;

import com.acme.bankapp.domain.account.Account;

/**
 * Class is a presentation of the client.
 *
 * @author S.Zhidkov
 */
public class Client {

    private String name;
    private Account account;
    private int age;
    private Gender gender;

    /**
     * Creates new client.
     * @param name name of the client
     * @param account account of the client
     * @param age age of the client
     * @param gender gender of the client
     */
    public Client(final String name, final Account account, final int age, final Gender gender) {
        this.name = name;
        this.account = account;
        this.age = age;
        this.gender = gender;
    }

    /**
     * Returns all accounts of the client.
     * @return account of the client
     */
    public Account getAccounts() {
        return account;
    }

    /**
     * Returns client salutation.
     * @return String
     */
    public String getClientSalutation() {
        return gender.getSalutation();
    }

    @Override
    public String toString() {
        return gender.getSalutation() + " " + name + ": [gender: " + gender + "] [age: " + age + "] " + account;
    }
}
